<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of tt_iterchk</title>
  <meta name="keywords" content="tt_iterchk">
  <meta name="description" content="Checks arguments to iterative methods. A is a TT object.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../index.html">Home</a> &gt;  <a href="#">tt2</a> &gt; <a href="index.html">solve</a> &gt; tt_iterchk.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for tt2/solve&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>tt_iterchk
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>Checks arguments to iterative methods. A is a TT object.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function [atype,afun,afcnstr] = tt_iterchk(A) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment">Checks arguments to iterative methods. A is a TT object.
   [ATYPE,AFUN,AFCNSTR] = TT_ITERCHK(A) returns the following:
   ATYPE is either 'matrix', 'function', 'expression' or 'inline object'.
   AFUN is the function name or inline object.
   AFUN is '' if ATYPE is 'matrix'.
   AFCNSTR is the function name if ATYPE is 'function'.
   AFCNSTR is the formula of the function if ATYPE is 'expression' or
   'inline object'.  AFCNSTR is '' if ATYPE is 'matrix'.

   See also BICG, BICGSTAB, CGS, GMRES, LSQR, MINRES, PCG, QMR, SYMMLQ.</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
</ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="tt_gmres.html" class="code" title="function [x,RESVEC,rw,rx] = tt_gmres(A, b, tol, maxout, maxin, eps_x, eps_z, M1, M2, M3, x0, verbose, varargin)">tt_gmres</a>	TT-GMRES method</li></ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [atype,afun,afcnstr] = tt_iterchk(A)</a>
0002 <span class="comment">%Checks arguments to iterative methods. A is a TT object.</span>
0003 <span class="comment">%   [ATYPE,AFUN,AFCNSTR] = TT_ITERCHK(A) returns the following:</span>
0004 <span class="comment">%   ATYPE is either 'matrix', 'function', 'expression' or 'inline object'.</span>
0005 <span class="comment">%   AFUN is the function name or inline object.</span>
0006 <span class="comment">%   AFUN is '' if ATYPE is 'matrix'.</span>
0007 <span class="comment">%   AFCNSTR is the function name if ATYPE is 'function'.</span>
0008 <span class="comment">%   AFCNSTR is the formula of the function if ATYPE is 'expression' or</span>
0009 <span class="comment">%   'inline object'.  AFCNSTR is '' if ATYPE is 'matrix'.</span>
0010 <span class="comment">%</span>
0011 <span class="comment">%   See also BICG, BICGSTAB, CGS, GMRES, LSQR, MINRES, PCG, QMR, SYMMLQ.</span>
0012 
0013 <span class="comment">%   Copyright 1984-2004 The MathWorks, Inc.</span>
0014 <span class="comment">%   $Revision: 1.8.4.2 $ $Date: 2004/12/06 16:35:56 $</span>
0015 
0016 
0017 [afun,afunmsg] = fcnchk(A);
0018 <span class="keyword">if</span> isempty(afunmsg)
0019    <span class="keyword">if</span> isa(afun,<span class="string">'inline'</span>)      
0020       <span class="keyword">if</span> isa(A,<span class="string">'inline'</span>)
0021          atype = <span class="string">'inline object'</span>;
0022       <span class="keyword">else</span>
0023          atype = <span class="string">'expression'</span>;
0024       <span class="keyword">end</span>
0025       afcnstr = formula(afun);
0026    <span class="keyword">else</span> <span class="comment">% both function_handles @fun and function names 'fun'</span>
0027       atype = <span class="string">'function'</span>;
0028       <span class="keyword">if</span> isa(A,<span class="string">'function_handle'</span>)
0029           afcnstr = func2str(A);
0030       <span class="keyword">else</span>
0031           afcnstr = A;
0032       <span class="keyword">end</span>
0033    <span class="keyword">end</span>
0034 <span class="keyword">elseif</span> isa(A,<span class="string">'cell'</span>)
0035    afun = A;
0036    atype = <span class="string">'matrix'</span>;
0037    afcnstr = <span class="string">''</span>;
0038 <span class="keyword">else</span>
0039    error(<span class="string">'MATLAB:iterchk:InvalidInput'</span>,<span class="keyword">...</span>
0040          <span class="string">'Argument must be a TT matrix in cell or a function handle.'</span>);
0041 <span class="keyword">end</span></pre></div>
<hr><address>Generated on Wed 08-Feb-2012 18:20:24 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>